package com.kang.consumer;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;
/**
 * 注意下 @RocketMQMessageListener 这个注解的其他属性
 **/
@Component
@RocketMQMessageListener(
    consumerGroup = "${rocketmq.consumer.group}",
    topic = "${rocketmq.consumer.topic}",
    consumeMode= ConsumeMode.CONCURRENTLY,
    messageModel= MessageModel.BROADCASTING,
    selectorExpression = "*" // 确定tag
)
public class SpringConsumer implements RocketMQListener<String> {
    @Override
    public void onMessage(String message) {
        System.out.println("Received TOPIC_PUSH_TEST message : "+ message);
    }
}
